package com.sgg.gulimall_product.controller;


import com.sgg.gulimall_common.api.Result;
import com.sgg.gulimall_common.to.ProductUPTo;
import com.sgg.gulimall_product.openFeign.ProductFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/elasticSearch")
public class ProductElasticSearchController {


    @Autowired
    private ProductFeignService productFeignService;

    @PostMapping("/save")
    public Result save(@RequestBody List<ProductUPTo> productUPToList){
        return productFeignService.elasticSearchIndex(productUPToList);
    }


}
